#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int reArrangeArray(int* nums, int len)
{
    // write code here
    int count = 0;
    for (int i = 0; i < len - 1; i++)
    {
        while (nums[i] == nums[i + 1])
        {
            if (i < len - 2)
            {
                for (int j = i + 1; j < len - 1; j++)
                {
                    nums[j] = nums[j + 1];
                }
            }
            count++;
            i++;
        }
    }
    return len - count;
}

int main()
{
    int arr[] = { 2,3,7,9,9 };
    int sz = sizeof(arr) / sizeof(arr[0]);
    int ret=reArrangeArray(arr, sz);
    for (int i = 0; i < ret; i++)
    {
        printf("%d ", arr[i]);
    }
    return 0;
}